<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>AUI快速完成布局</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style type="text/css">
        .text-white {
            color: #ffffff !important;
        }
        .aui-grid [class*=aui-col-] {
            padding: 0.75rem 0;
        }
        .aui-list-item.wechat-top {
            background-color: #f3f3f7;
        }
        .aui-list .wechat-avatar {
            width:4rem;
        }
        .wechat-avatar .aui-row-padded {
            background-color: #dddee0;
            padding: 0.1rem;
            border-radius: 0.2rem;
            margin-left: -0.05rem;
            margin-right: -0.05rem;
        }
        .wechat-avatar .aui-row-padded [class*=aui-col-xs-] {
            padding: 0.05rem;
        }
        .wechat-avatar,
        .wechat-avatar > img {
            border-radius:0.2rem;
        }
    </style>
</head>
<body>

  <section class="aui-content aui-margin-b-15 aui-content-padded">
      <div class="aui-list aui-media-list" id="head_id">
              <!--<div class="aui-media-list-item-inner">
                  <div class="aui-list-item-media wechat-avatar">
                      <img id="img_id" src="../image/demo1.png">
                  </div>
                  <div class="aui-list-item-inner">
                      <div class="aui-list-item-text">
                          <div class="aui-list-item-title">张翼</div>
                          <div class="aui-list-item-right">管理员</div>
                      </div>
                      <div class="aui-list-item-text">

                      </div>
                  </div>
              </div>
              <div class="aui-info" style="padding-top:0">
                  <div class="aui-info-item">
                      <span class="aui-margin-l-5">邦建通讯设备有限公司</span>
                  </div>
                  <div class="aui-info-item">1001</div>
              </div>-->
      </div>
  </section>


    <section class="aui-content">
        <ul class="aui-list aui-list-in aui-margin-b-15">
            <li class="aui-list-item" onclick="openWin('my_daily')">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-pencil aui-text-info"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow">
                    <div class="aui-list-item-title">日报</div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-share aui-text-danger"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow">
                    <div class="aui-list-item-title">流程</div>
                </div>
            </li>
            <li class="aui-list-item" onclick="openWin('collection')">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-star aui-text-info"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow">
                    <div class="aui-list-item-title">收藏</div>
                </div>
            </li>
            <li class="aui-list-item" onclick="openWin('sign_list')">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-map aui-text-info"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow">
                    <div class="aui-list-item-title">打卡记录</div>
                </div>
            </li>
        </ul>
        <ul class="aui-list aui-list-in">

            <li class="aui-list-item" onclick="openWin('setting')">
                <div class="aui-list-item-label-icon">
                    <i class="aui-iconfont aui-icon-gear aui-text-info"></i>
                </div>
                <div class="aui-list-item-inner aui-list-item-arrow">
                    <div class="aui-list-item-title">设置</div>
                </div>
            </li>
        </ul>
    </section>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/aui-toast.js" ></script>
<script type="text/javascript">
    var toast = new auiToast();
    apiready = function () {
        var username = $api.getStorage("username");
        if(username){
            api.ajax({
                url: ServeUrl+'m=Index&a=getUserInfo',
                method: 'post',
                dataType : 'json',
                data: {
                    values: {
                        username : username,
                    }
                }
            },function(ret, err){
                //alert(JSON.stringify(ret));
                if (ret.data) {
                    if(ret.data.user_img){
                        user_img = 'http://101.37.91.134/include/data/headImg/'+ret.data.user_img;
                    }else {
                        user_img = '../image/demo1.png';
                    }
                    var html='<div class="aui-media-list-item-inner">'
                    html+='<div class="aui-list-item-media wechat-avatar">'
                    html+='<img id="img_id" src="'+user_img+'">'
                    html+='</div>'
                    html+='<div class="aui-list-item-inner">'
                    html+='<div class="aui-list-item-text">'
                    html+='<div class="aui-list-item-title">'+ret.data.cn_name+'</div>'
                    html+='<div class="aui-list-item-right">'+ret.data.r_name+'</div>'
                    html+='</div>'
                    html+='<div class="aui-list-item-text">'

                    html+='</div>'
                    html+='</div>'
                    html+='</div>'
                    html+='<div class="aui-info" style="padding-top:0">'
                    html+='<div class="aui-info-item">'
                    html+='<span class="aui-margin-l-5">'+ret.data.d_name+'</span>'
                    html+='</div>'
                    html+='<div class="aui-info-item">'+ret.data.username+'</div>'
                    html+='</div>';
                    document.getElementById('head_id').innerHTML = html;
                }
            });
        }

        api.addEventListener({
	          name:'loginSuccess'
        },function(ret,err){
        	  window.location.reload();
        	  //coding...
        });

    }

    function openWin(name) {
        api.openWin({
            name: name,
            url: name+'_win.html',
            /*animation:{
                type:"ripple",                //动画类型（详见动画类型常量）
                subType:"from_right",       //动画子类型（详见动画子类型常量）
                duration:300                //动画过渡时间，默认300毫秒
            }*/

        });
    }
</script>
</html>
